<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自定义方法</title>
</head>
<body>
    
</body>
<script>
    var a = 1;
    var b = 2;
    if(a > b){
        console.log(a + '比' + b + '大');
    }else{
        console.log(b + '比' + a + '大');
    }

    //自定义方法
    function bijiao(x,y){
        if(x > y){
            console.log(x + '比' + y + '大');
        }else{
            console.log(y + '比' + a + '大');
        }
    }

    // 调用方法
    bijiao(1,2);
    bijiao(1,3);
    bijiao(5,4);
    bijiao(1,9);
</script>
</html>